package br.com.classesinternasedatas;

import java.text.NumberFormat;
import java.util.Locale;

public class TesteNumberFormat2 {
	public static void main(String[] args) {		
		
		float f2 = 789.123456f;
		Locale l = new Locale("us");
		NumberFormat nf2 [] = new NumberFormat[4];
		nf2[0] = NumberFormat.getInstance();
		nf2[1] = NumberFormat.getInstance(l);
		nf2[2] = NumberFormat.getCurrencyInstance();
		nf2[3] = NumberFormat.getCurrencyInstance(l);//
		
		for (NumberFormat nf3 : nf2)
			System.out.println(nf3.format(f2));
		System.out.println();
		
		float f = 36.9652f;
		NumberFormat nf = NumberFormat.getInstance();
		
		System.out.println(nf.getMaximumFractionDigits());
		System.out.println(nf.format(f));
		
		//nf.setMinimumFractionDigits(2);
		//System.out.println(nf.getMinimumFractionDigits());
		//System.out.println(nf.format(f));
		
		nf.setMaximumFractionDigits(2);
		System.out.println(nf.format(f));
		
	}
}
